package com.mq.batch.producer;

import org.springframework.amqp.rabbit.core.BatchingRabbitTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author ytj
 * @date 2024/1/15
 */
@Component
public class Demo4Producer {
    @Resource
    private BatchingRabbitTemplate batchingRabbitTemplate;

    public void send(Integer id){
        Demo4Message demo4Message=new Demo4Message(id);
        batchingRabbitTemplate.convertAndSend(Demo4Message.EXCHANGE_NAME,Demo4Message.ROUTE_KEY,demo4Message);
    }
}
